@extends('layout.default')

@section('content')

  @include('layout.swiper')

  {{ csrf_field() }}
  <input type="hidden" name="member" value="{{$member->uuid}}">
  <input type="hidden" name="recruit" value="{{$recruit->uuid}}">
  <input type="hidden" name="status" value="">
  <div class="weui-panel weui-panel_access">
    <div class="weui-panel__hd">应聘详情</div>
    <div class="weui-panel__bd">
      <div class="weui-media-box weui-media-box_appmsg" style="align-items:normal;-webkit-align-items:normal;">
        <div class="weui-media-box__hd" style="height:90px; ">
          <img class="weui-media-box__thumb img-round" src="/assets/images/avatar.png">
          <p style="font-size: 80%;height:29px;line-height: 29px;"><i
                class="iconfont member_{{$recruit->gendar}}"></i> {{$recruit->age}}岁</p>
        </div>
        <div class="weui-media-box__bd">
          <h4 class="weui-media-box__title">{{$recruit->name}}</h4>
          <p class="weui-media-box__desc">{{$recruit->desc}}</p>
          <ul class="weui-media-box__info">
            <li class="weui-media-box__info__meta"><b>{{$recruit->mobile}}</b></li>
            <li class="weui-media-box__info__meta weui-media-box__info__meta_extra">{{$recruit->birthday}}</li>
          </ul>
        </div>

      </div>


    </div>
    <div class="weui-panel__ft">
      <div class="weui-cell weui-cell_access weui-cell_link verify">
        <div class="weui-cell__bd label">{!!$recruit->present()->memberRecruit!!}</div>
        <span class="weui-cell__ft"></span>
      </div>
    </div>
  </div>

  <div class="weui-btn-area">
    <a href="{{route('list')}}">
      <button class="weui-btn weui-btn_default wx-default">返回</button>
    </a>
  </div>

@stop

@section('javascript')
  <script src="//cdn.bootcss.com/jquery-weui/1.2.1/js/swiper.min.js"></script>
  <script src="//cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.js"></script>
  <script src="//res.wx.qq.com/open/libs/weuijs/1.2.1/weui.min.js"></script>
  <script type="text/javascript">
      $(function () {

          $('.verify').on('click', function () {
              var that = $(this);
              weui.picker([{
                  label: '<span class="green">审核通过</span>',
                  value: 2
              }, {
                  label: '<span class="grey">审核拒绝</span>',
                  value: 3
              }], {
                  onChange: function (result) {
                      //console.log(result);
                  },
                  onConfirm: function (result) {
                      $.post("{{route('verify',$recruit->uuid)}}", {
                          '_token': $("input[name='_token']").attr('value'),
                          'status': result[0]['value'],
                          'is_submit': true
                      }, function (data) {
                          that.find('.label').html(result[0]['label']);

                      }, 'json').error(function (data) {
                          layer.msg(data.responseJSON.message);
                      });

                      console.log(result);
                  },
                  title: '应聘审核'
              });
          });

          $('.swiper-container').swiper({
              loop: true,
              autoplay: 5000,
              pagination: '.swiper-pagination',
              paginationClickable: true
          });

      });
  </script>

@stop